import request from '@/utils/request.js'
// 添加购物车
export const addCartList=(obj)=>{
  return request.post('/member/cart',obj)
}

// 获取购物车列表
export const getCartList=()=>{
  return request.get('/member/cart')
}

// 删除购物车列表
export const deleteCartList=(ids)=>{
  return request({
    url:'/member/cart',
    method:'DELETE',
    data:{
      ids
    }
  })
}

// 修改数量
export const updateCartList=(id,selected,count)=>{
  return request.put(`/member/cart/${id}`,{selected,count})
}

// 修改购物车状态
export const updateCartStatus=(selected,ids)=>{
  return request.put('/member/cart/selected',{selected,ids})
}

// 合并购物车  skuId,selected,count
export const mergeCartAPI=(data)=>{
  return request.post('/member/cart/merge',data)
}